package edu.cibertec.alquiler.service;

import java.util.ArrayList;
import java.util.List;

import edu.cibertec.alquiler.bean.VideoBean;
import edu.cibertec.alquiler.dao.VideoDAO;
import edu.cibertec.alquiler.entity.DetalleUsuarioVideo;
import edu.cibertec.alquiler.entity.Video;
import edu.cibertec.alquiler.factory.DAOFactory;

public class VideoDaoService implements VideoService{
	
	private VideoDAO dao;
	private DAOFactory fabrica = null;
	
	public VideoDaoService(int bd) {
		fabrica= DAOFactory.getDAOFactory(bd);
		this.dao= fabrica.getVideoDAO();
	}

	@Override
	public List<Video> listarVideos() throws Exception {
		return dao.listarVideos();
	}

	@Override
	public void insertarNuevoVideo(Video bean) throws Exception {
		dao.insertarNuevoVideo(bean);		
	}

	@Override
	public void nuevoPrestamo(DetalleUsuarioVideo bean) throws Exception {
		dao.nuevoPrestamo(bean);
	}

	@Override
	public Video buscarVideo(Video bean) throws Exception {
		return dao.buscarVideo(bean);
	}

	@Override
	public void actualizarVideo(Video bean) throws Exception {
		dao.actualizarVideo(bean);
	}

	@Override
	public void eliminarVideo(Video bean) throws Exception {
		dao.eliminarVideo(bean);
	}

	@Override
	public ArrayList<VideoBean> getVideosFiltrados(VideoBean filtro)
			throws Exception {
		// TODO Auto-generated method stub
		return dao.getVideosFiltrados(filtro);
	}

	
	
}
